local sprotoparser = require "sprotoparser"

local proto = {}


proto.c2s = sprotoparser.parse [[
.package {
	type 		0 : integer
	session 	1 : integer
}

login 		1 {
	request {
		name 		0 : string
		password 	1 : string
	}	
}

logout 		2 {
	request {
		id 	0  : integer
	}	
}

get_player_list 3 {

}

send_message 4 {
	request {
		send_id       0  : integer
		receive_id    1  : integer
		message       2  : string
	}
}

.player_info {
	id  0: integer
	pos 1: *double
	rot 2: *double
}

sync_players 5{
	request {
		id  0: integer
		posX 1: double
		posY 2: double
		posZ 3: double
		rot1 4: double
		rot2 5: double
		rot3 6: double
		rot4 7: double
		speed 8: double
		rotSpeed 9: double
		airBorne 10: boolean
	}
}

send_jump 6{
	request {
		id	0 : integer
	}
}

send_play_vfx 7 {
	request {
	 id 0 : integer
	}
}

]]

proto.s2c = sprotoparser.parse [[
.package {
	type 		0 : integer
	session 	1 : integer
}

login 		1 {
	request {
		id 		0 : integer
		name	1 : string
	}
}

logout 		2 {
	request {
		id 	0  : integer
	}	
}

enter_scene 	3 {
	request {	
		id 		0 : integer
		name	1 : string
		scene	2 : integer
		avatar	3 : integer
		pos 	4 : *double
	}
}

send_message	4 {
	request {
		send_id       0  : integer
		receive_id    1  : integer
		message       2  : string
	}
}

.player {
	id      0 : integer
	name	1 : string
	scene   2 : integer
	avatar  3 : integer
	pos     4 : *double
}

get_player_list 5 {
	request {
		player_list 0 : *player
	}
}

load_online_player 6{
	request {
		players  0 : *player
	}
}

.player_info {
	id  0: integer
	pos 1: *double
	rot 2: *double
}

sync_players 7{
	request {
		id  0: integer
		posX 1: double
		posY 2: double
		posZ 3: double
		rot1 4: double
		rot2 5: double
		rot3 6: double
		rot4 7: double
		speed 8: double
		rotSpeed 9: double
		airBorne 10: boolean
	}
}

send_jump 8{
	request {
		id	0 : integer
	}
}

recv_play_vfx	9	{
	request	{
		id	0 : integer
	}
}

]]

return proto
